package com.apanal.qlife.sys.model;

import java.util.List;

import com.apanal.qlife.common.model.BaseModel;
import com.apanal.qlife.common.model.ModelConvert;

/**
 * 群组实体类
 * 
 * 
 * @author shuliangxing
 * 
 * @date 2015-8-31下午5:40:03
 */
public class Group extends BaseModel {
	/**
	 * 
	 */
	private static final long serialVersionUID = -572270265655450491L;

	/**
	 * id
	 */
	private Long groId;

	/**
	 * id字符串,逗号分隔
	 */
	private String groIds;

	/**
	 * 组名
	 */
	private String groName;

	/**
	 * 描述
	 */
	private String groDesc;

	/**
	 * 数据是否正常(可逆状态), 1:正常, 0:停用,来自t_dictionary.NORMAL
	 */
	private Integer normal;

	/**
	 * 资源集合
	 */
	private List<Resource> resourceList;

	/**
	 * 资源id字符串,逗号分隔
	 */
	private String resourceIds;

	/**
	 * 资源名称字符串,逗号分隔
	 */
	private String resourceNames;

	/**
	 * 角色集合
	 */
	private List<Role> roleList;

	/**
	 * 角色id字符串,逗号分隔
	 */
	private String rolIds;

	/**
	 * 角色名称字符串,逗号分隔
	 */
	private String rolNames;

	/**
	 * 用户集合
	 */
	private List<User> userList;

	/**
	 * 用户id字符串,逗号分隔
	 */
	private String userIds;

	/**
	 * 用户名称字符串,逗号分隔
	 */
	private String userNames;

	public Long getGroId() {
		return groId;
	}

	public void setGroId(Long groId) {
		this.groId = groId;
	}

	public String getGroName() {
		return groName;
	}

	public void setGroName(String groName) {
		this.groName = groName == null ? null : groName.trim();
	}

	public String getGroDesc() {
		return groDesc;
	}

	public void setGroDesc(String groDesc) {
		this.groDesc = groDesc == null ? null : groDesc.trim();
	}

	public Integer getNormal() {
		return normal;
	}

	public void setNormal(Integer normal) {
		this.normal = normal;
	}

	public List<Resource> getResourceList() {
		return resourceList;
	}

	public void setResourceList(List<Resource> resourceList) {
		this.resourceList = resourceList;
	}

	public String getResourceIds() {
		if ((resourceIds == null || "".equals(resourceIds))
				&& resourceList != null && !resourceList.isEmpty()) {
			return ModelConvert.getIds(resourceList);
		} else {
			return resourceIds;
		}
	}

	public void setResourceIds(String resourceIds) {
		this.resourceIds = resourceIds;
	}

	public List<Role> getRoleList() {
		return roleList;
	}

	public void setRoleList(List<Role> roleList) {
		this.roleList = roleList;
	}

	public String getRolIds() {
		if ((rolIds == null || "".equals(rolIds)) && roleList != null
				&& !roleList.isEmpty()) {
			return ModelConvert.getIds(roleList);
		} else {
			return rolIds;
		}
	}

	public void setRolIds(String rolIds) {
		this.rolIds = rolIds;
	}

	public List<User> getUserList() {
		return userList;
	}

	public void setUserList(List<User> userList) {
		this.userList = userList;
	}

	public String getUserIds() {
		if ((userIds == null || "".equals(userIds)) && userList != null
				&& !userList.isEmpty()) {
			return ModelConvert.getIds(userList);
		} else {
			return userIds;
		}
	}

	public void setUserIds(String userIds) {
		this.userIds = userIds;
	}

	public String getGroIds() {
		return groIds;
	}

	public void setGroIds(String groIds) {
		this.groIds = groIds;
	}

	public String getResourceNames() {
		if ((resourceNames == null || "".equals(resourceNames))
				&& resourceList != null && !resourceList.isEmpty()) {
			return ModelConvert.getNames(resourceList);
		} else {
			return resourceNames;
		}
	}

	public void setResourceNames(String resourceNames) {
		this.resourceNames = resourceNames;
	}

	public String getRolNames() {
		if ((rolNames == null || "".equals(rolNames)) && roleList != null
				&& !roleList.isEmpty()) {
			return ModelConvert.getNames(roleList);
		} else {
			return rolNames;
		}
	}

	public void setRolNames(String rolNames) {
		this.rolNames = rolNames;
	}

	public String getUserNames() {
		if ((userNames == null || "".equals(userNames)) && userList != null
				&& !userList.isEmpty()) {
			return ModelConvert.getNames(userList);
		} else {
			return userNames;
		}
	}

	public void setUserNames(String userNames) {
		this.userNames = userNames;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	@Override
	public String toString() {
		return "Group [groId=" + groId + ", groIds=" + groIds + ", groName="
				+ groName + ", groDesc=" + groDesc + ", normal=" + normal
				+ ", resourceList=" + resourceList + ", resourceIds="
				+ resourceIds + ", resourceNames=" + resourceNames
				+ ", roleList=" + roleList + ", rolIds=" + rolIds
				+ ", rolNames=" + rolNames + ", userList=" + userList
				+ ", userIds=" + userIds + ", userNames=" + userNames + "]";
	}

}